#pragma once
#include <afxtempl.h>

class CSubFormCollection  
{
public:
	CSubFormCollection();
	virtual ~CSubFormCollection();

	bool SetActive(int ix);   
	bool CreateSubForm(CDialog* pDlg,CWnd* pParentWnd,int iIndex);
	bool ShowSubForm(int ix = -1);
	void SetRelPos(const CRect& rect) {m_Rect = rect;m_bCentered = false;};
	void SetCenterPos(const CRect& rect) {m_Rect = rect;m_bCentered = true;};
protected:
	CArray<CDialog*, CDialog*> m_Forms; // array with all forms
	int m_nActiveForm;  // index to the currently active sub form
	CRect m_Rect;       // position of the sub form
	bool m_bCentered;   
	void AddForm(CDialog* dlg,int iIndex) { return(m_Forms.InsertAt(iIndex,dlg));}; 
};

